%%----------- 已知传递函数求时域响应 ------------

%% 方法1：反拉普拉斯变换
clear;

syms s t
% Fs = 1/(s^2+2*s+5);
Fs = 1/((s+1-2i)*(s+1+2i));
% Fs = 2/s;

ft = ilaplace(Fs, s, t);

ft_ = zeros(1000,1);
for tn=1:1:1000
    ft_(tn) = subs(ft,t,(tn-1)*0.01);
end

plot(ft_)

%% 方法2：求脉冲响应
clear;

s = tf('s');
% Fs = 1/(s^2+2*s+5);
Fs = 1/((s+1-2i)*(s+1+2i));
% Fs = 2/s;

impulse(Fs)